/**   
* @Title: AbsScrollView.java 
* @Package com.esun.util.custom 
* @Description: (可监听scrollview) 
* @author: City Jiangsy@500wan.com   
* @date: 2011-8-19 下午02:57:39  
* Copyright: (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
*/
package com.esun.util.custom;


import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

/** 
 * @ClassName: AbsScrollView 
 * @Description: (可监听scrollview) 
 * @author: City Jiangsy@500wan.com
 * @date: 2011-8-19 下午02:57:39 
 *  
 */
public class AbsScrollView extends ScrollView{

	private ScrollViewListener scrollViewListener = null;


	public AbsScrollView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	public AbsScrollView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public AbsScrollView(Context context) {
		super(context);
	}

	public void setScrollViewListener(ScrollViewListener scrollViewListener) {
		this.scrollViewListener = scrollViewListener;
	}

	@Override
	protected void onScrollChanged(int x, int y, int oldx, int oldy) {
		super.onScrollChanged(x, y, oldx, oldy);
		if (scrollViewListener != null) {
			scrollViewListener.onScrollChanged(this, x, y, oldx, oldy);
		}
	}
	
	public int getTotalVerticalScrollRange() {
		return computeVerticalScrollRange();
	}

}
